package com.jiwei.community.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jiwei.community.dto.AddPostDto;
import com.jiwei.community.entity.Post;
import com.jiwei.community.vo.ResponseResult;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Set;


/**
 * (Post)表服务接口
 *
 * @author jiwei
 * @since 2024-03-20 11:00:01
 */
public interface PostService extends IService<Post> {

    ResponseResult publish(AddPostDto post);

    ResponseResult getPostList(Integer pageNum, Integer pageSize, Long communityId, Integer sectionId, Integer isTop, Integer isEssence);

    ResponseResult likePost(Long postId, Long userId);
    ResponseResult cancelLike(Long postId,Long userId);

    ResponseResult getPostDetail(Long postId);
    void saveCacheCollectNum();
    void saveCacheLikedNum();
    void saveCacheViewNum();
    void saveCacheCommentNum();

    ResponseResult updateViewCount(Long postId);
    Integer updateCacheCommentNum(Long postId,Integer increase);

    ResponseResult isLiked(Long userId, Long postId);


    ResponseResult searchPost(String title, Long communityId);

    ResponseResult isMyPost(Long userId, Long postId);

    ResponseResult updateMyPost(Long userId, Post post);

    ResponseResult deleteMyPost(Long userId, Long postId);

    ResponseResult rewardPost(Long userId, Long postId, Integer integral);

    ResponseResult getMyPostList(Long userId,Integer pageNum, Integer pageSize);
}

